﻿@using Masa.Blazor.Presets

<PModal @bind-Value="value" 
        Persistent
        Title="Title"
        Width="500"
        SaveProps="props => props.Outlined = true"
        CancelProps="@(props => props.Color = "orange")"
        DeleteProps="@(props => props.Style = "font-weight:bold;")"
        OnSave="OnSave" 
        OnCancel="OnCancel" 
        OnDelete="OnDelete">
    <ActivatorContent>
        <MButton @attributes="@context.Attrs">Activator</MButton>
    </ActivatorContent>
    <ChildContent>
        Content
    </ChildContent>
</PModal>

@code {

    private bool value;

    private async Task OnSave()
    {
        await Task.Delay(1000);

        value = false;
    }

    private void OnCancel()
    {
        value = false;
    }

    private void OnDelete()
    {
        value = false;
    }

}